<!DOCTYPE HTML>
<html lang="en">
<head>
    <meta charset="UTF-8">
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>在线答题考试系统</title>

    <link href="../static/bootstrap-4.3.1-dist/css/bootstrap.min.css" rel="stylesheet">
    <!-- 必须在引入bootstarp.js之前引入 -->
    <script src="../static/jquery-3.3.1.min.js"></script>

    <script src="../static/bootstrap-4.3.1-dist/js/bootstrap.min.js"></script>

    <script src="../static/js/jquery-1.11.3.min.js"></script>
    <script src="../static/js/jquery.countdown.js"></script>
    <!--时间js-->
    <link href="../static/css/main.css" rel="stylesheet" type="text/css" />

    <link href="../static/css/test.css" rel="stylesheet" type="text/css" />
<style>
.hasBeenAnswer {
	background: #5d9cec;
	color:#fff;
}
</style>

</head>
<body>

<nav class="navbar navbar-expand-sm bg-light navbar-light ">
    <ul class="navbar-nav">
        <li class="nav-item active">
            <a class="nav-link"><h3>在线考试系统</h3></a>
        </li>

        <li class="nav-item active">
            <a class="nav-link"><h3>当前科目:{{ subject }}</h3></a>
        </li>
        <li style="position: fixed;right: 70px; font-size: 30px;color: #9fcdff">{{ student.name }}</li>

    </ul>
</nav>
<div class="main">
	<!--nr start-->
	<div class="test_main">
		<div class="nr_left">
			<div class="test">
				<form action="/calGrade/" method="post">
                <input type="hidden" name="sid" value="{{ student.id }}">
                <input type="hidden" name="subject" value="{{ subject }}">
					<div class="test_title">
						<p class="test_time">
							<i class="icon iconfont">&#xe6fb;</i><b class="alt-1">01:40</b>
						</p>
						<font><input type="submit" name="tijiao" value="交卷"></font>
					</div>

						<div class="test_content">
							<div class="test_content_title">
								<h2>单选题</h2>
								<p>
									<span>共</span><i class="content_lit">10</i><span>题，</span>
                                    <span>合计</span><i class="content_fs">10</i><span>分</span>
								</p>
							</div>
						</div>
						<div class="test_content_nr">
							<ul>
                                {% for paper1 in paper %}
                                   {% for test in paper1.pid.all %}
                                       <li id="{{ forloop.counter }}">
                                        <div class="test_content_nr_tt">
											<i>{{ forloop.counter}}</i><span>({{ test.score }}分)</span>
                                            <font>{{ test.title }}</font>

										</div>
                                       <div class="test_content_nr_main">
											<ul>
													<li class="option">
															<input type="radio" class="radioOrCheck" name="{{ test.id }}"
                                                            value="A"/>
														<label>A.
                                                            <p class="ue" style="display: inline;">{{ test.optionA }}</p>
														</label>
													</li>

													<li class="option">
															<input type="radio" class="radioOrCheck" name="{{ test.id }}"
                                                            value="B"/>
														<label>
															B.<p class="ue" style="display: inline;">{{ test.optionB }}</p>
														</label>
													</li>

													<li class="option">
															<input type="radio" class="radioOrCheck" name="{{ test.id }}"
                                                            value="C"/>
														<label>
															C.<p class="ue" style="display: inline;">{{ test.optionC }}</p>
														</label>
													</li>

													<li class="option">
															<input type="radio" class="radioOrCheck" name="{{ test.id }}"
                                                            value="D"/>
														<label>
															D.<p class="ue" style="display: inline;">{{ test.optionD }}</p>
														</label>
													</li>
											</ul>
										</div>
                                        </li>
                                   {% endfor %}
                                {% endfor %}
							</ul>
						</div>
				</form>
			</div>
		</div>

{#		<div class="nr_right">#}
{#			<div class="nr_rt_main">#}
{#				<div class="rt_nr1">#}
{#					<div class="rt_nr1_title">#}
{#						<h1>#}
{#							<i class="icon iconfont">&#xe692;</i>答题卡#}
{#						</h1>#}
{#						<p class="test_time">#}
{#							<i class="icon iconfont">&#xe6fb;</i><b class="alt-1">01:40</b>#}
{#						</p>#}
{#					</div>#}
{##}
{#						<div class="rt_content">#}
{#							<div class="rt_content_tt">#}
{#								<h2>单选题</h2>#}
{#								<p>#}
{#									<span>共</span><i class="content_lit">10</i><span>题</span>#}
{#								</p>#}
{#							</div>#}
{#							<div class="rt_content_nr answerSheet">#}
{#								<ul>#}
{#                                    {% for paper1 in paper %}#}
{#                                        {% for foo in paper1.pid.all %}#}
{#                                           <li><a href="#{{ forloop.counter }}">{{ forloop.counter }}</a></li>#}
{#                                        {% endfor %}#}
{#                                    {% endfor %}#}
{#								</ul>#}
{#							</div>#}
{#						</div>#}
{#				</div>#}
{##}
{#			</div>#}
{#		</div>#}
	</div>
	<!--nr end-->
	<div class="foot"></div>
</div>


<script>
	window.jQuery(function($) {
		"use strict";

		$('time').countDown({
			with_separators : false
		});
		$('.alt-1').countDown({
			css_class : 'countdown-alt-1'
		});
		$('.alt-2').countDown({
			css_class : 'countdown-alt-2'
		});

	});


	{% comment %}$(function() {
		$('li.option label').click(function() {
		debugger;
			var examId = $(this).closest('.test_content_nr_main').closest('li').attr('id'); // 得到题目ID
			var cardLi = $('a[href=#' + examId + ']'); // 根据题目ID找到对应答题卡
			// 设置已答题
			if(!cardLi.hasClass('hasBeenAnswer')){
				cardLi.addClass('hasBeenAnswer');
			}});
	});
{% endcomment %}
</script>


</body>
</html>
